<template>
  <div id="box">
    <HeaderDian :head="head"/>
    <div class="contentDian">
      <BannerDian :banner="banner"/>
      <Fenlei :changguan="changguan"/>
      <RecommendDian :dazhe="dazhe"/>

      <GoodsShow :leimu="leimu"/>
      <BackToTop />
      
    </div>
<FooterLife />
  </div>
</template>

<script>
//chuang
import {mapState,mapActions} from "vuex"
import HeaderDian from "../zh-components/HeaderDian.vue";
import BannerDian from "../zh-components/BannerDian.vue";
import Fenlei from "../zh-components/Fenlei.vue";
import RecommendDian from "../zh-components/RecommendDian.vue";
import GoodsShow from "../zh-components/GoodsShow.vue";
import Footer from "../zh-components/Footer.vue";
import BackToTop from "../zh-components/BackToTop.vue";
import GoodsShowTool from "../zh-components/GoodsShowTool.vue";
import FooterLife from "../zh-components/FooterLife.vue";
import axios from "axios";

export default {
  name: "LifeHome",
  components: {
    HeaderDian,
    BannerDian,
    Fenlei,
    RecommendDian,
    GoodsShow,
    Footer,
    BackToTop,
    GoodsShowTool,
    FooterLife
  },
  data() {
    return {
      head: {},
      banner: {},
      changguan: {},
      dazhe: {},
      leimu: {}
    };
  },
  // computed:{
  //   ...mapState(["moduleZH"])
  // },
  // methods:{
  //   ...mapActions({"getData":"moduleZH/getData"}),
  //   getData(){
  //     this.getData(2301)
  //   }
  // },
  created() {
    // this.getData();
    axios
      .all([
        // 写请求路径
        axios.get("/headerZ/2302"),
        axios.get("/bannerZ/2302"),
        axios.get("/changguanZ/2302"),
        axios.get("/dazheZ/2302"),
        axios.get("/leimuZ/2302"),
      ])
      .then(
        axios.spread((
          // 写请求返回的参数名名字
          head,
          banner,
          changguan,
          dazhe,
          leimu,
        )=> {
          // 写返回值的处理
          this.head = head.data;

          this.banner = banner.data;

          this.changguan = changguan.data;

          this.dazhe = dazhe.data;

          this.leimu = leimu.data;

        })
      );
  
  },
};
</script>

<style scoped>
@import url(../zh-assets/zh-iconfont/iconfont.css);
#box {
  display: flex;
  flex-direction: column;
  background-color: rgb(242, 242, 242);
}
.contentDian {
  width: 100%;
  /* flex:1; */
  overflow-y: auto;
  margin-bottom: 0.6rem;
}
.contentDian::-webkit-scrollbar {
  display: none;
}
</style>